const install = Vue => {
	// 将方法挂在到vue实例
	Vue.prototype.$popup = {
		show(params) { // 当审批流数量大于1时，打开选项弹层
			let that = this;
			// Vue.store 传递参数
			Vue.prototype.$store.commit('ChangeAndSetStateData', {
				Name1: 'st_comPageConfig.showGlobalPopup',
				data: true
			})
			Vue.prototype.$store.commit('ChangeAndSetStateData', {
				Name1: 'BaseScreenParm',
				data: params
			})
			// #ifdef APP-PLUS
			uni.navigateTo({
				url: '/uni_modules/mc-ui/components/m-node-warp/compontentPage/m-globalPopup/m-globalPopup',
				events: {
					confirm: function(data) {
						params.confirm && params.confirm()
					},
					cancel: function(data) {
						params.cancel && params.cancel()
					}
				}
			})
			// #endif
		},

		showFormApprove(params) { // 审批单据弹层
			let that = this;
			Vue.prototype.$store.commit('ChangeAndSetStateData', {
				Name1: 'st_comPageConfig.showFormApprove',
				data: true
			})
			Vue.prototype.$store.commit('ChangeAndSetStateData', {
				Name1: 'BaseScreenParm',
				data: params
			})
			// #ifdef APP-PLUS
			uni.navigateTo({
				url: '/uni_modules/mc-ui/components/m-node-warp/compontentPage/m-globalPopup/m-formApprovePopup',
				events: {
					confirm: function(data) {
						params.confirm && params.confirm(data)
					},
					doneConfirm: function(data) {
						params.doneConfirm && params.doneConfirm(data)
					},
					cancel: function(data) {
						params.cancel && params.cancel(data)
					}
				}
			})
			// #endif
		},

		showListApprove(params) { // 查阅审批流
			let that = this;
			Vue.prototype.$store.commit('ChangeAndSetStateData', {
				Name1: 'st_comPageConfig.showListApprove',
				data: true
			})
			Vue.prototype.$store.commit('ChangeAndSetStateData', {
				Name1: 'BaseScreenParm',
				data: params
			})
			uni.navigateTo({
				url: '/uni_modules/mc-ui/components/m-node-warp/compontentPage/m-globalPopup/m-approveListPage',
				events: {
					confirm: function(data) {
						params.confirm && params.confirm(data)
					},
					cancel: function(data) {
						params.cancel && params.cancel(data)
					}
				}
			})
		}

	}
}

export default install;